<?
	function crearConexion(){
		$hostname = 'localhost';
		$dbname = 'abd';
		$username = 'abd';
		$password = 'practica';
		
		try{
	        $dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
	        return $dbh;
		        
		}catch( PDOException $e ) {
		        echo "error de conexión: ".$e->GetMessage();
		}
                
	}
	
	function cerrarConexion($dbh){
		$dbh = null;
	}
?>